module.exports = function () {
    [].concat(...arguments).forEach((el) => {
        if (el == undefined) return;

        el.addEventListener('touchstart', function () {
            var top = el.scrollTop;
            var totalScroll = el.scrollHeight;
            var currentScroll = top + el.offsetHeight;

            //滚到最上面时，往下滚1px
            //滚到最下面时，往上滚1px
            if (top === 0) {
                el.scrollTop = 5;
            } else if (currentScroll === totalScroll) {
                el.scrollTop = top - 5;
            }
        });

        el.addEventListener('touchmove', function (evt) {
            //在元素的高度内，可以滚动
            if (el.scrollHeight - el.scrollTop > el.offsetHeight) {
                evt._isScroller = true;
            }
        });
    });
}